import plotly.express as px
from scatter_diagram.eq_explore_data import lons, lats
from scatter_diagram.eq_piot import data

fig = px.scatter(
    data,
    x='经度',
    y='纬度',
    range_x=[-200,200],
    range_y=[-90,90],
    width=1200,
    height=800,
    title='全球地震散点图',
    size='震级',
    size_max=10,  # size_max为图表中圆点的大小
    color='震级',
    hover_name='位置'
)

# fig.write_html('global_earthquakes.html')  # 保存散点图到当前目录下
fig.show()

